<%-- 
    Document   : poner_falla
    Created on : 5/08/2013, 12:59:12 AM
    Author     : wbeimar
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="cons" class="DAO.Consulta"/>
<jsp:useBean id="f" class="VO.falla"/>
<jsp:setProperty name="f" property="*"/>
<!DOCTYPE html>
<html>
    <head>
        <jsp:include page="includes/head.jsp"></jsp:include>
        <title>Fallas Alumnos | Aplicativo Colegio</title>
    </head>
    <body>
        
        <jsp:include page="includes/nav_bar.jsp"></jsp:include>
        
        <!--<div class="row"><a href="javascript:history.back()"><img src="img/volver.png" class="span1" /></a>
                 <h1 class="span10">Agregar falla a estudiante</h1>
             </div> -->
        
        <%
        String id_asi=request.getParameter("id_asi");
        String id_al=request.getParameter("id_al");
        String doc=request.getParameter("doc");
        String id_gp=request.getParameter("grupo");
            if(request.getMethod()=="POST"){
                //out.print("es post");
                
                f.setdocumento_estudiante(doc);
                f.setid_asignatura(id_asi);
                f.setid_estudiante(id_al);
                
                
                Date dNow = new Date();
                SimpleDateFormat ft = 
                new SimpleDateFormat("yyyy-MM-dd");
                String currentDate = ft.format(dNow);
                
                f.setfecha_falla(currentDate);
                
                cons.registrar("falla", f);
                %>
                
                
            
            <div class="container container-fluid"    >
                <div class="alert span8 alert-success">
                    <a class="close" data-dismiss="alert">×</a>
                    
                        <strong>Correcto!</strong> La Falla  ha sido Asignada correctamente.

                    </div>        
            </div>
                
                
                
                
                
                
                <%
                
                
                
                
                //response.sendRedirect("listado_estudiantes_asignatura.jsp?grupo="+id_gp+"msg=success");
            }
            
            
        %>
        
        <form class="form-horizontal" name="crear_asignatura" method="POST" action="poner_falla.jsp?id_al=<%=id_al%>&id_asi=<%=id_asi%>&doc=<%=doc%>&grupo=<%=id_gp%>">
    <fieldset>

    <!-- Form Name -->
    <legend><a href="listado_estudiantes_asignatura.jsp?grupo=<%=id_gp%>&asignatura=<%=id_asi%>"><img src="img/volver.png" class="span1" /></a>Registrar Falla Alumno</legend>

    <div class="table span12">
    <%
    out.print(cons.Ver_info("", "", ""));
    %>
    </div>
    
    <!-- Text input-->
    <div class="control-group">
     <label class="control-label" for="numero_falla">Valor Falla: </label>
      <div class="controls">
        <input id="numero_falla" name="numero_falla" type="number" placeholder="Valor Falla" class="input-large" min="0" value="1" required="">   
      </div>
    </div>
    
    <div class="control-group">
     <label class="control-label" for="falla_justificacion">Justificacion falla: </label>
      <div class="controls">
        <input id="falla_justificacion" name="falla_justificacion" type="text" placeholder="Justificacion Falla" class="input-xxlarge"  required="">   
      </div>
    </div>
    
    
    <!-- Button -->
    <div class="control-group">

      <div class="controls">
        <button id="guardar" name="guardar" class="btn btn-primary">Crear</button>
      </div>
    </div>

    </fieldset>
</form>
        
        
        
        
        
        
    </body>
</html>
